<template>
    <div>
        <van-nav-bar
        title="用户反馈"
        left-arrow
        @click-left="onClickLeft"
        />
        <p class="bt">用户反馈</p>
        <p class="cct">来说说你的问题或建议吧，对于你所提供的信息，我们将严格保密仅用于分析研究。</p>
        <div class="block"></div>
        <p class="fro">说说你的建议或遇到的问题吧~</p>
        <p class="bz">如果您愿意收到我们的反馈，请留下您的联系方式。</p>
        <van-form @submit="onSubmit">
            <van-cell-group inset>
                <van-field
                    v-model="message"
                    rows="5"
                    autosize
                    type="textarea"
                    maxlength="200"
                    placeholder="填写的信息越全，问题越可有效解决哦~"
                    show-word-limit
                />
            </van-cell-group>
            <div style="margin: 16px;">
                <van-button round block type="primary" @click="btn" native-type="submit">
                提交
                </van-button>
            </div>
        </van-form>
    </div>
</template>

<script>
import { ref } from 'vue';
import axios from 'axios';
import router from '@/router';
    export default {
        setup() {
            const message = ref('');
            const onClickLeft = () => history.back();
            const value = ref('');
            return {
                onClickLeft,
                value,
                message,
            };
        },
        methods: {
            btn() {
                axios.post("http://localhost:8087/feedback/saveFeedback", {
                    feedbackContent: this.message,
                }).then(()=>{
                    router.push('/four')
                })
            }
        }
    };

</script>

<style lang="scss" scoped>
    p{
        text-align: left;
        margin-left: 5vw;
        margin-right: 5vw;
        margin-top: 3vw;
    }
    .bt{
        font-weight: bold;
        font-size: 6vw;
    }
    .cct{
        font-size: 4.5vw;
    }
    .fro{
        font-weight: bold;
        font-size: 4.5vw;
        margin-top: 5vw;
        margin-left: 8vw;
    }
    .bz{
        font-size: 3.5vw;
        margin-left: 8vw;
        margin-top: 1vw;
    }
    .block{
        margin-top: 5vw;
        height: 1vw;
        background-color: #eee;
    }
    ::v-deep .van-field__control{
        margin-top: 1vw;
        // background-color: #eee;
        border:solid;
        border-color: #ccc;
        padding-left: 2vw;
        padding-top: 2vw;
        border-width: 1px;
    }
</style>